﻿<%@ Page Title="iTracker Home" Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" MasterPageFile="~/site.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#grid1").jqGrid({
                datatype: "local",
                width: 940,
                colNames: ['ID', 'Part #', 'Description', 'QTY', 'ReOrd#'],
                colModel: [
               		{ name: 'ID', index: 'ID', hidden: true },
                    { name: 'PartNumber', index: 'PartNumber', width: 25, align: 'left' },
               		{ name: 'Description', index: 'Description' },
               		{ name: 'Quantity', index: 'Quantity', width: 15, sorttype: 'int', align: 'center' },
               		{ name: 'ReorderPoint', index: 'ReorderPoint', width: 15, sorttype: 'int', align: 'center' }
               	],
                sortable: true,
                altRows: true,
                viewrecords: true,
                altclass: "ITrackerGridViewRowAlternate",
                onSelectRow: function(id) {
                    var rowData = $(this).getRowData(id);
                    var temp = rowData["ID"];
                    location.href='Item/' + temp;
                    }
            });
            var myData = [ 
                <%= GetDataForGrid() %>
                ];
            for (var i = 0; i <= myData.length; i++)
                $("#grid1").addRowData(i, myData[i]);
    });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <h2>Reorder Alerts:</h2>
    <table id="grid1" class="ITrackerGridView"></table>
</asp:Content>

